-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version check step #524
base: main
Are you sure you want to change the base?
Version check step #524
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added a version check step to the PyPI release workflow to ensure version consistency between packages before deployment.
- Added version comparison step in
.github/workflows/pypi_release.yaml
that extracts and validates matching versions from bothinfinity_client
andinfinity_emb
pyproject.toml files - Fails the workflow early if versions don't match to prevent inconsistent package releases
- Provides clear error messaging showing the mismatched versions for debugging
💡 (4/5) You can add custom instructions or style guidelines for the bot here!
1 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
.github/workflows/pypi_release.yaml
Outdated
version1=$(grep 'version = ' "$file1" | sed 's/version = //' | tr -d '\"') | ||
version2=$(grep 'version = ' "$file2" | sed 's/version = //' | tr -d '\"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The grep pattern is fragile and may fail if there are comments containing 'version = ' or if the version field spans multiple lines. Consider using a TOML parser instead.
.github/workflows/pypi_release.yaml
Outdated
if [ "$version1" != "$version2" ]; then | ||
echo "Version mismatch: $version1 != $version2" | ||
exit 1 | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Version comparison should handle cases where version strings are empty or malformed. Add validation before comparison.
if [ "$version1" != "$version2" ]; then | |
echo "Version mismatch: $version1 != $version2" | |
exit 1 | |
else | |
if [ -z "$version1" ] || [ -z "$version2" ]; then | |
echo "Error: Empty version string detected" | |
exit 1 | |
elif [ "$version1" != "$version2" ]; then | |
echo "Version mismatch: $version1 != $version2" | |
exit 1 | |
else |
.github/workflows/pypi_release.yaml
Outdated
working-directory: ${{ github.workspace }} | ||
run: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Setting working-directory to github.workspace is redundant since the paths are already absolute. This can be removed.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #524 +/- ##
=======================================
Coverage 79.86% 79.86%
=======================================
Files 43 43
Lines 3486 3486
=======================================
Hits 2784 2784
Misses 702 702 ☔ View full report in Codecov by Sentry. |
Makes sense, but was internationally not bumping infinity_client. Perhaps a ci that would auto generate the client would be better. |
That makes sense. And the package version of the generated client should match what the openapi description reports in the version field? |
I created a initial version of it, the idea is with changes to main the client will be regenerated and if there are changes a PR will be opened. |
Related Issue
closes #521
Checklist
Additional Notes
Added step to release pipeline to error out if the versions do not match.